package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;
@Table(name="FUNCTIONGN")
@Entity
public class Function {
    private Integer gId;
    private String gName;
    private String gLu;
    private String gIcon;
    private Sort sortBySortId;
    private Long gRank;
   private Functions functionsList;
    @ManyToOne
    @JoinColumn(name = "sort_id", referencedColumnName = "sort_id")
    public Sort getSortBySortId() {
        return sortBySortId;
    }

    public void setSortBySortId(Sort sortBySortId) {
        this.sortBySortId = sortBySortId;
    }

    @ManyToOne
    @JoinColumn(name="FST_ID")
    public Functions getFunctionsList() {
        return functionsList;
    }

    public void setFunctionsList(Functions functionsList) {
        this.functionsList = functionsList;
    }

    @Id
    @Column(name = "g_id")
    public Integer getgId() {
        return gId;
    }

    public void setgId(Integer gId) {
        this.gId = gId;
    }

    @Basic
    @Column(name = "g_name")
    public String getgName() {
        return gName;
    }

    public void setgName(String gName) {
        this.gName = gName;
    }

    @Basic
    @Column(name = "g_lu")
    public String getgLu() {
        return gLu;
    }

    public void setgLu(String gLu) {
        this.gLu = gLu;
    }

    @Basic
    @Column(name = "g_icon")
    public String getgIcon() {
        return gIcon;
    }

    public void setgIcon(String gIcon) {
        this.gIcon = gIcon;
    }

    @Basic
    @Column(name = "g_rank")
    public Long getgRank() {
        return gRank;
    }

    public void setgRank(Long gRank) {
        this.gRank = gRank;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Function function = (Function) o;
        return gId == function.gId &&
                Objects.equals(gName, function.gName) &&
                Objects.equals(gLu, function.gLu) &&
                Objects.equals(gIcon, function.gIcon) &&
                Objects.equals(gRank, function.gRank);
    }

    @Override
    public int hashCode() {
        return Objects.hash(gId, gName, gLu, gIcon, gRank);
    }
}
